const express = require('express');
const router = express.Router();


//鉴权  管理员即可开放以下路由，非管理员不可访问
router.use('/',(req,res,next) => {
    if(req.session.userInfo.admin === 1){
        next()
    }else{
        return res.send({
            code: 3,
            msg: '非管理员用户'
        })
    }
})

//查询用户表
router.use('/find',require('./controllers/find'))

//删除用户表
router.use('/delete',require('./controllers/delete'))

//修改用户表
router.use('/update',require('./controllers/update'))

//新增用户表
router.use('/add',require('./controllers/add'))
module.exports = router
